package ejemplo;
import org.uqbar.arena.actions.MessageSend;
//import org.uqbar.arena.examples.conversor.ConversorWindow;
import org.uqbar.arena.layout.VerticalLayout;
import org.uqbar.arena.widgets.Button;
import org.uqbar.arena.widgets.Label;
import org.uqbar.arena.widgets.Panel;
import org.uqbar.arena.widgets.TextBox;
import org.uqbar.arena.windows.MainWindow;



public class Ejemplo  extends MainWindow<Conversor> {

	public Ejemplo() {
		super(new Conversor());
	}

	@Override
	public void createContents(Panel mainPanel) {
		mainPanel.setLayout(new VerticalLayout());

		TextBox millas = new TextBox(mainPanel);
		millas.bindValueToProperty(Conversor.MILLAS);

		Button convertir = new Button(mainPanel);
		convertir.setCaption("Traducir");
		convertir.onClick(new MessageSend(this.getModel(), Conversor.CONVERTIR));

		Label kilometros = new Label(mainPanel);
		kilometros.bindValueToProperty(Conversor.KILOMETROS);
	}
	
	public static void main(String[] args) {
		new Ejemplo().startApplication();
	}
	}